<template>
  <div id="user-info">
    <a href="#" class="clear-fix">
      <slot name="user-icon">
        <svg class="privateImage-svg left">
          <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#avatar-default"></use>
        </svg>
      </slot>
      <div class="login-info left">
        <slot name="user-nickname" v-if="$store.state.user.length == 0">
          <div  @click="loginClick">登录/注册</div>
        </slot>
        <slot name="user-nickname" v-else>
          ゞ
          {{$store.state.user[0].username}}
          এ᭄ꦿ゛
          <span @click="completeClick">完善详细信息</span>
        </slot>
        <div class="phone">
          <span>
            <svg data-v-735ff1be="" fill="#fff" class="icon-mobile"><use data-v-735ff1be="" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#mobile"></use></svg>
          </span>
          <slot name="user-phone" v-if="$store.state.user.length == 0">暂无绑定手机号</slot>
          <slot name="user-phone" v-else>{{$store.state.user[0].phone}}</slot>
        </div>
      </div>
      <svg data-v-735ff1be="" fill="#fff" class="arrow-svg right"><use data-v-735ff1be="" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#arrow-right"></use></svg>
    </a>
  </div>
</template>

<script>
	export default {
		name: "UserInfo",
    methods: {
      loginClick() {
        this.$router.push('/profile/login');
      },
      completeClick() {
        this.$router.push('/profile/complete');
      }
    },
	}
</script>

<style scoped>
  #user-info {
    background-color: greenyellow;
    padding: 15px;
    margin-top: -5px;
  }

  #user-info .privateImage-svg {
    width: 60px;
    height: 60px;
    background-color: #fff;
    border-radius: 30px;
  }

  .left {
    float: left;
  }

  #user-info .arrow-svg {
    width: 11px;
    height: 22px;
    margin-top: 18px;
  }

  #user-info .login-info {
    color: #fff;
    margin: 10px 0 0 30px;
  }

  #user-info .login-info .phone {
    position: relative;

    font-size: 20px;
    margin-top: 5px;
    margin-left: 15px;
    font-weight: 300;
  }

  #user-info .login-info .phone .icon-mobile {
    position: absolute;
    width: 12px;
    height: 18px;
    left: -15px;
    top: 0px;
  }
</style>
